<!DOCTYPE html>
<html>
<head>
    <%include("/common/header.html",{title:'设置我的资料'}){}%>
</head>
<body>
<div id="add-main" lay-filter="add-main" style="display: none;">
    <form class="layui-form" id="add-form" action="">
        <div class="layui-form-item center" >
            <label class="layui-form-label" style="width: 100px" >配置名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" required value="" style="width: 240px" lay-verify="required" placeholder="请输入配置名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">配置类型</label>
            <div class="layui-input-block">
                <input type="text" name="id" required style="width: 240px" lay-verify="required" placeholder="请输入配置类型" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">配置值 </label>
            <div class="layui-input-block">
                <input type="text" name="phone" required style="width: 240px" lay-verify="required" placeholder="请输入配置值" autocomplete="off" class="layui-input">
                <!-- <input type="hidden" name="id" style="width: 240px" autocomplete="off" class="layui-input"> -->
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="save" >立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary" id="closeBtn" >重置</button>
            </div>
        </div>
    </form>
</div>
<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<%include("/common/foot.html"){}%>
<script>
    layui.use(['table','layer','form','element','jquery'],function(){
        var layer = layui.layer;
        var table = layui.table;
        var form = layui.form;
        var element = layui.element;
        var $ = layui.$;
        //第一个实例
        table.render({
            elem: '#LAY-user-manage'
            ,url: 'carousel/findAll.jhtml' //数据接口
            ,page: true //开启分页
            ,limits: [10, 20, 30, 50], //控制多少行一页（默认五条一页）
            defaultToolbar: ['filter', 'print', 'exports']
            ,cols: [[ //表头
                {type: 'checkbox', fixed: 'left'}
                ,{field: 'title', title: '标题', width: 150, sort: true, totalRow: true}
                ,{field: 'content', title: '内容描述', width:150, sort: true}
                ,{field: 'image', title: '图片', width:150, sort: true}
                ,{field: 'createDate', title: '更新时间', width: 150, sort: true, totalRow: true}
                ,{fixed: 'right', title:'操作',width: 200, align:'center', toolbar: '#barDemo'}
            ]]
        });

        table.on('tool(LAY-user-manage)',function (obj) {
            layer.open({
                type: 1
                , title: ['修改信息']
                , btn: ['确定', '取消']
                , shadeClose: true
                , shade: 0
                , content: $("#add-main")
            });
        });

    });
</script>
</body>
</html>